//
//  SIXMyCardController.m
//  weibo
//
//  Created by   李小云 on 16/5/22.
//  Copyright © 2016年 chuhan. All rights reserved.
//

#import "SIXMyCardController.h"
#import "Masonry.h"

@interface SIXMyCardController ()

@end

@implementation SIXMyCardController

- (void)viewDidLoad {
    [super viewDidLoad];
    /**
     *  设置导航栏内容
     */
    
    self.navigationController.navigationBar.tintColor = [UIColor grayColor];
    
    self.view.backgroundColor = [UIColor grayColor];
    self.navigationItem.title = @"我的名片";
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"navigationbar_more"] style:UIBarButtonItemStylePlain target:self action:@selector(rigthBtn)];
    
    [self setChildView];
}
/**
 *  监听左边按钮点击事件 分享到其他网站
 */
-(void)rigthBtn{
    

}
/**
 *  设置子控件方法
 */
-(void)setChildView{
    /**
     添加主view
     */
    __weak __typeof(&*self)weakSelf = self;
    UIView *bigView = [[UIView alloc]init];
    bigView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:bigView];
    
    [bigView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.offset(104);
        make.right.offset(-60);
        make.left.offset(60);
        make.bottom.offset(-150);
        make.center.mas_equalTo(weakSelf.view);
        
    }];
    
    UIImageView *image = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"MyCard"]];
    [bigView addSubview:image];
    [image mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.offset(40);
        make.right.offset(-40);
        make.left.offset(40);
        make.bottom.offset(-200);
        
    }];
    
    UILabel *lable = [[UILabel alloc]init];
    lable.text = @"扫一扫二维码图案,关注我吧";
    lable.textColor = [UIColor grayColor];
    lable.font = [UIFont systemFontOfSize:13];
    lable.textAlignment = NSTextAlignmentCenter;
    [lable sizeToFit];
    [bigView addSubview:lable];
    
    [lable mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.bottom.offset(-20);
        make.centerX.mas_equalTo(weakSelf.view);
    }];
    
    
    UILabel *Namelable = [[UILabel alloc]init];
    Namelable.text = @"木子小楼";
    Namelable.textColor = [UIColor blackColor];
    Namelable.font = [UIFont systemFontOfSize:17];
    Namelable.textAlignment = NSTextAlignmentCenter;
    [Namelable sizeToFit];
    [bigView addSubview:Namelable];
    
    [Namelable mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.bottom.mas_equalTo(lable.mas_top).offset(-5);
        make.height.mas_equalTo(40);
        make.centerX.mas_equalTo(weakSelf.view);
    }];
    
    
    UIImageView *nameImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"68"]];
    [bigView addSubview:nameImage];
    
//    nameImage.frame = CGRectMake(0, 0, 100, 100);
    [nameImage mas_makeConstraints:^(MASConstraintMaker *make) {
        
         make.centerX.mas_equalTo(weakSelf.view);
         make.bottom.mas_equalTo(Namelable.mas_top).offset(-5);
         make.height.width.mas_equalTo(80);
        
    }];
    
    
    UIView *rightView = [[UIView alloc]init];
    rightView.backgroundColor = [UIColor grayColor];
    rightView.alpha = 0.4;
    [bigView addSubview:rightView];
    [rightView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.offset(2);
        make.right.offset(-10);
        make.left.mas_equalTo(nameImage.mas_right).offset(10);
        make.bottom.offset(-125);
   
    }];
    
    UIView *leftView = [[UIView alloc]init];
    leftView.backgroundColor = [UIColor grayColor];
    leftView.alpha = 0.4;
    [bigView addSubview:leftView];
    [leftView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.offset(2);
        make.left.offset(10);
        make.right.mas_equalTo(nameImage.mas_left).offset(-10);
          make.bottom.offset(-125);
     
    }];
    
   
}
@end
